#四大基础数据结构CRUD

#list
a = []
a.append("a")
a = a + ["b"] + ["c"] + ["d"] + ["e"]
a += ['a']
b = a * 10
b *= 10
a.insert(0,"a")
print(a[0:6:2])
a.index("a")
a[0] = "1"
a[:2] = "s"
a.sort()
b = sorted(a)
a.reverse()
b = reversed(a)
a.pop()
a.clear()

#tuple
t = (1,2,3,4,5,6,7,8,9)
t.index(1)
print(t[0])
print(t[0:3])

#dict
d = {"1":"1", 2:2}
d1 = {3:3, 4:4}
d.update(d1)
d.setdefault("a",1)
print(d["1"])
d.get("1")
d.get("2","2")
d.keys()
d.values()
d.items()
d.pop("1")
d.popitem()
d.clear()

#set
s = set([1,2,3,4,5,6,7,8,9])
s1 = {"a", "b", "c"}
s.add(1)
s.update(s1)
print("a" in s)
s.union(s1)
s.remove("a")
s.discard("b")
s.pop()